/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;

import POJO.SanPhamPOJO;
import java.sql.SQLException;
import java.util.ArrayList;
import ultil.MySqlDataAccessHelper;

/**
 *
 * @author NGUYEN CONG BINH
 */
public class ChiTietDonDatHangDAO {
    public static  boolean taoChiTietDonDatHang(ArrayList<SanPhamPOJO> dsDonHang,int maHoaDon) throws SQLException
    {
        boolean kq = false;
        try {
            int n = 0;
            
//            
//            String sql = String.format("INSERT INTO nguoidung( tenDangNhap, matKhau, maCapBac, hoTenNguoiDung,diaChi, eMail, dienThoai) VALUES ('%s','%s', %d ,'%s','%s','%s',%d)", kh.getTenDangNhap(), kh.getMatKhau(),kh.getMaCapBac() ,kh.getHoTenNguoiDung(), kh.getDiaChi(), kh.geteMail(), kh.getDienThoai());
            MySqlDataAccessHelper helper = new MySqlDataAccessHelper();
            helper.open();
//            n = helper.executeUpdate(sql);
            
            if (n == 1) {
                kq = true;
            }
            helper.close();
        } catch (Exception ex) {
            System.err.println(ex);
        }
        return kq;
    }
}
